<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>
<body>
    <div id="app">
        <button @click="islogin=true">登录</button>
        <button @click="islogin=false">注册</button>
        <h1>{{islogin?'登录':'注册'}}</h1>
        <form action="###" class="login" key="login" v-if="islogin">
           登录用户名： <input type="text" name="login" v-model.trim="username"><br>
           登录密码： <input type="password" name="login" v-model.trim="password">
        </form>
        <form action="###" class="register" key="register" v-else>
            注册用户名： <input type="text" name="register" v-model.trim="username"><br>
            注册密码： <input type="password" name="register" v-model.trim="password">
         </form>
    </div>

    <script>
        Vue.config.productionTip = false;
        const vm = new Vue({
            el:'#app',
            data(){
                return{
                    username:'',
                    password:'',
                    islogin:true
                }
            }
        })
    </script>
</body>
</html>